package elements;

import java.awt.Color;
import java.util.HashMap;

import shapes.Linha;
import shapes.Poligono;
import shapes.Ponto;
import shapes.Shape;

public class DisplayFile{

	public Window window;
	public HashMap<String, Shape> shapes;
	public HashMap<String, Shape> clipshapes;

	public DisplayFile() {
		shapes = new HashMap<String, Shape>();
		clipshapes = new HashMap<String, Shape>();
		window = new Window(shapes,clipshapes);
		window.setViewportDimension(495,495);
		
		//LINHAS DE NAVEGACAO
		double[][] linha = {{0,0},{-490,+490},{1,1}} ;
		addLinha( linha, Color.lightGray, "RETA Y");
		
		double[][] linha1 = {{-1000,+1000},{0,0},{1,1}} ;
		addLinha( linha1, Color.lightGray, "RETA X");
	}

	public void addPonto(double[][] pts, Color cor, String nome) {
		shapes.put(nome, new Ponto(pts, cor, nome));
		window.refresh();
	}

	public void addLinha(double[][] pts, Color cor, String nome) {
		shapes.put(nome, new Linha(pts, cor, nome));
		window.refresh();
	}

	public void addPoligono(double[][] pts, Color cor, String nome, Boolean sl) {
		shapes.put(nome, new Poligono(pts, cor, nome,sl));
		window.refresh();
	}
	
	public void removeShape(String n){
		shapes.remove(n);
		window.refresh();
	}
	
	public void addcPonto(double[][] pts, Color cor, String nome) {
		clipshapes.put(nome, new Ponto(pts, cor, nome));
		window.refresh();
	}

	public void addcLinha(double[][] pts, Color cor, String nome) {
		clipshapes.put(nome, new Linha(pts, cor, nome));
		window.refresh();
	}

	public void addcPoligono(double[][] pts, Color cor, String nome, Boolean sl) {
		clipshapes.put(nome, new Poligono(pts, cor, nome,sl));
		window.refresh();
	}

}

